/**
 * 
 */
package diary;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.LayoutManager;

import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JList;


/**
 * @author Kevin Hanson
 *
 */
public class DiaryHeadListPanel extends JPanel {

	/**
	 * 
	 */
	public DiaryHeadListPanel() {
		setLayout(new GridLayout(0, 1));
		DefaultListModel diaryHeadListModel = new DefaultListModel();
		diaryHeadListModel.addElement("2010-8-9");
		diaryHeadListModel.addElement("2010-9-10");
		diaryHeadListModel.addElement("2010-9-12");

		//JList diaryHeadList = new JList(diaryHeadListModel);
		ListMenu diaryHeadList = new ListMenu(diaryHeadListModel);
		JScrollPane diaryHeadListScrollPane = new JScrollPane(diaryHeadList);
		diaryHeadListScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
		diaryHeadListScrollPane.setPreferredSize(new Dimension(120, 60));
		diaryHeadListScrollPane.setBorder(BorderFactory.createCompoundBorder(
				BorderFactory.createTitledBorder("DHeaders"), 
				BorderFactory.createEmptyBorder(5, 5, 5, 5)));
		
		add(diaryHeadListScrollPane);
	}

	/**
	 * @param layout
	 */
	public DiaryHeadListPanel(LayoutManager layout) {
		super(layout);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param isDoubleBuffered
	 */
	public DiaryHeadListPanel(boolean isDoubleBuffered) {
		super(isDoubleBuffered);
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param layout
	 * @param isDoubleBuffered
	 */
	public DiaryHeadListPanel(LayoutManager layout, boolean isDoubleBuffered) {
		super(layout, isDoubleBuffered);
		// TODO Auto-generated constructor stub
	}

}
